{% extends 'base.html' %}
{# 读取静态资源 #}
{% load static %}

{% block search %}
    <ul class="layui-nav layui-layout-left">
        <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
            <i class="layui-icon layui-icon-spread-left"></i>
        </li>
        <li class="layui-nav-item layui-hide-xs"><a href="{% url 'books:books' %}?t=文学">文学</a></li>
        <li class="layui-nav-item layui-hide-xs"><a href="{% url 'books:books' %}?t=哲学">哲学</a></li>
        <li class="layui-nav-item layui-hide-xs"><a href="{% url 'books:books' %}?t=传记">传记</a></li>
    </ul>
{% endblock search %}

{% block content %}
    <div class="layui-body">
        <div style="padding: 15px;">
            {#主体#}
            <div class="layui-bg-gray" style="padding: 16px;">
                <div class="layui-row layui-col-space15">
                    {% for n in booklist %}
                        <div class="layui-col-md6">
                        <div class="layui-card">
                            <div class="layui-card-header">
                                <a href="{% url 'books:detail' n.id %}">
                                    <img src="{{ n.img.url }}">
                                </a>
                            </div>
                            <div class="layui-card-body">
                                {{ n.name }}
                            </div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
            <br><br>
        </div>
    </div>
{% endblock content %}